import request from '@/utils/axios'

// 根据类型获取字典数据
export const getDictList = (params: any) => {
  return request.get({
    url: `/dict/api/dict/data/page?page=1&limit=1000&dictType=${params.type}&dictLabel=${params.label}`
  })
}

export const getDictAreaList = (params: any) => {
  return request.get({
    url: `/dict/api/dict/data/getByDictType?type=area&patientId=${params.patientId}`
  })
}

// 患者信息更新
export const updatePatientInfo = (params: any) => {
  return request.post({
    url: `/eprofile-web/api/patient/info/update`,
    data: params
  })
}

// 基本信息
export const getPatientInfo = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/info/${data.empi}` })
}

// 医疗信息获取
export const getMedicalInfo = (params: any) => {
  return request.get({
    url: `/eprofile-web/api/patient/info/history/medical/${params.empi}`
  })
}

// 查询问卷答案
export const getQuestionnaireAnswer = (params: any) => {
  return request.get({
    url: `/eprofile-web/api/question/getGlobalQuestionnaireAnswer?empi=${params.empi}`
  })
}

// 问卷表单
export const getQuestionnaireInfo = (params: any) => {
  return request.post({
    url: `/path/api/questionnaire/getQuestionnaireAndAnswer`,
    data: params
  })
}

// 生活习惯表单保存--新
export const saveQuestionnaireNew = (params: any) => {
  return request.post({
    url: `/path/api/questionnaire/save`,
    data: params
  })
}
